<table id="datagrid_${action_id}" ></table>
<script type="text/javascript">

$(function(){
	
	$('#datagrid_${action_id}').datagrid({
		iconCls:'icon-save',
		width:'auto',
		height:'auto',
		nowrap: false,
		fit:true,
		fitColumns:true,
		striped: true,
		url:'${request.contextPath}${namespace?default('')}/agency/user-datagrid.json?id=${id?default('')}',
		sortName: 'gmtCreate',
		sortOrder: 'desc',
		remoteSort: true,
		singleSelect : true,
		idField:'id',
		onBeforeLoad:function(){$('#datagrid_${action_id}').datagrid('unselectAll');},
		columns:[[
					{field:'name',title:'${action.getDatagridTitle('name')}',width:80,align:'center'},
					{field:'subName',title:'${action.getDatagridTitle('subName')}',width:80,align:'center'},
					{field:'address',title:'${action.getDatagridTitle('address')}',width:150,align:'center'},
					{field:'mobile',title:'${action.getDatagridTitle('mobile')}',width:80,align:'center'},
					{field:'linkPhone',title:'${action.getDatagridTitle('linkPhone')}',width:80,align:'center'},
					{field:'gmtCreate',title:'${action.getDatagridTitle('gmtCreate')}',width:80,align:'center',sortable:true},
					{field:'state',title:'${action.getDatagridTitle('state')}',width:50,align:'center',formatter:function(val, rec){
						<#list states as state >
							if(val== ${state.state}){
								return '${action.getDatagridTitle('state.'+state.name())}'
							}
						</#list>
					}}
				]],
		pagination:true,
		rownumbers:true,
		onDblClickRow:function(idx,data){if(typeof onDblClickRow_${action_id} != 'undefined'){onDblClickRow_${action_id}(idx,data)}},
		onClickRow:function(idx,data){if(typeof onClickRow_${action_id} != 'undefined'){onClickRow_${action_id}(idx,data)}},
		onRowContextMenu:function(e,idx,data){if(typeof onRowContextMenu_${action_id} != 'undefined'){$(this).datagrid('selectRow', idx);onRowContextMenu_${action_id}(e,idx,data)}}
	});

});

</script>	